public class test533 {
    public static void main(String[] args) {
        System.out.println("10000以下的完全数有：");
        for (int num = 2; num <= 10000; num++) {
            int sum = 1; 
            for (int i = 2; i <= Math.sqrt(num); i++) {
                if (num % i == 0) {
                    sum += i;
                    if (i != num / i) { 
                        sum += num / i;
                    }
                }
            }
            if (sum == num) {
                System.out.println(num);
            }
        }
    }
}
